﻿using System;
using System.ComponentModel;
using IssueVision.EntityModel;

namespace IssueVision.Common
{
    public interface IIssueVisionModel : INotifyPropertyChanged
    {
        void GetIssueTypesAsync();
        event EventHandler<ResultsArgs<IssueType>> GetIssueTypesCompleted;
        void GetPlatformsAsync();
        event EventHandler<ResultsArgs<Platform>> GetPlatformsCompleted;
        void GetResolutionsAsync();
        event EventHandler<ResultsArgs<Resolution>> GetResolutionsCompleted;
        void GetSecurityQuestionsAsync();
        event EventHandler<ResultsArgs<SecurityQuestion>> GetSecurityQuestionsCompleted;
        void GetStatusesAsync();
        event EventHandler<ResultsArgs<Status>> GetStatusesCompleted;
        void GetSubStatusesAsync();
        event EventHandler<ResultsArgs<SubStatus>> GetSubStatusesCompleted;
        void GetUsersAsync();
        event EventHandler<ResultsArgs<User>> GetUsersCompleted;
        void GetCurrentUserAsync();
        event EventHandler<ResultArgs<User>> GetCurrentUserCompleted;
        void GetCurrentUserProfileResetAsync();
        event EventHandler<ResultArgs<Boolean>> GetCurrentUserProfileResetCompleted;
        void GetAllIssuesAsync();
        event EventHandler<ResultsArgs<Issue>> GetAllIssuesCompleted;
        void GetMyIssuesAsync();
        event EventHandler<ResultsArgs<Issue>> GetMyIssuesCompleted;

        void GetAllUnresolvedIssuesAsync();
        event EventHandler<ResultsArgs<Issue>> GetAllUnresolvedIssuesCompleted;
        void GetActiveBugCountByMonthAsync(int numberOfMonth);
        event EventHandler<ResultsArgs<string>> GetActiveBugCountByMonthCompleted;
        void GetResolvedBugCountByMonthAsync(int numberOfMonth);
        event EventHandler<ResultsArgs<string>> GetResolvedBugCountByMonthCompleted;
        void GetActiveBugCountByPriorityAsync();
        event EventHandler<ResultsArgs<string>> GetActiveBugCountByPriorityCompleted;

        void GetIssueHistoryByIssueIDAsync(long issueID);
        event EventHandler<ResultsArgs<IssueHistory>> GetIssueHistoryByIssueIDCompleted;

        Exception GetLastError();
        void ClearLastError();
        Boolean AllowMultipleErrors { get; set; }

        Issue CurrentEditIssue { get; set; }
        User CurrentEditUser { get; set; }
        void SaveChangesAsync();
        event EventHandler<ResultArgs<string>> SaveChangesCompleted;
        void RejectChanges();

        Boolean HasChanges { get; }
        Boolean IsBusy { get; }
    }
}
